Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: return False when we do not discover any environment variables #388

Merged
merged 4 commits into from
Jun 5, 2022

Conversation

larsks
Copy link
Contributor

@larsks larsks commented Mar 15, 2022

This modifies Dotenv.set_as_environment_variables to return False
if we have not discovered any environment variables via either
dotenv_path or stream.

The return value gets passed through to load_dotenv, so this can be
used to determine if dotenv.load_dotenv was able to set anything.

Closes #321

@larsks larsks changed the title fix/load dotenv return code Return False when we do not discover any environment variables Mar 15, 2022
@larsks larsks force-pushed the fix/load-dotenv-return-code branch from 48e3fc7 to 020ac34 Compare March 15, 2022 01:58
The docstring for load_dotenv was missing a word, rendering it confusing.
This commits modifies it for clarity.
This modifies Dotenv.set_as_environment_variables to return False
if we have not discovered any environment variables via either
`dotenv_path` or `stream`.

The return value gets passed through to `load_dotenv`, so this can be
used to determine if `dotenv.load_dotenv` was able to set anything.

Closes theskumar#321
src/dotenv/main.py Outdated Show resolved Hide resolved
@theskumar theskumar changed the title Return False when we do not discover any environment variables feat: return False when we do not discover any environment variables Jun 5, 2022
@theskumar theskumar merged commit ee15221 into theskumar:master Jun 5, 2022
theskumar added a commit that referenced this pull request Jun 5, 2022
* master:
  feat: return False when we do not discover any environment variables (#388)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

load_dotenv() returns True even if .env file is not found
2 participants